<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/11/28
  Time: 17:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script type="application/javascript" src="./static/js/jquery-1.8.3.min.js"></script>
<script type="application/javascript">
    $(function () {
            $("#btn").click(function () {
               var user= {"userName":"lisi","userPassword":123}
               console.log(typeof (user))
               var  jsonstr=JSON.stringify(user)
                console.log(typeof (jsonstr))
                console.log(typeof (jsonObj))
                $.ajax({
                    url:"/getUserAjax",
                    data:JSON.stringify(user),
                    contentType:'application/json;charset=UTF-8',
                    type:"POST",
                    dataType:"json",
                    success:function (data) {
                        console.log(data)
                    }
                })
            })
    })

</script>
<body>

    <%
      String str="{\"id\":\"10\",\"age\":\"11\"}";
    %>
    <a href='/getUser/2/lisi'>RestFull风格</a>

<button id="btn">ajax测试</button>
<%--图片：<img src="./static/img/商城小程序.jpg">--%>
<a href="/getUser?id=2">测试Spring Mvc</a>
<a href="/paremtertoController?name=lisi">测试Spring Mvc</a>

<form action="/toUpload" method="post" enctype="multipart/form-data">
    <label>姓名</label>
    <input type="text" name="userName" value="">
    <label>密码</label>
    <input type="password" name="password" value="">
    <label>证件照</label>
    <input type="file" name="picPath" value="">
    <input type="submit" value="提交">
</form>
</body>
</html>
